import React,{useMemo, useState} from 'react'

export default function UesMemoTest() {
  const [count, setCount] = useState(0);
  const memorizedText = useMemo(()=> {
    console.log('this memo fun is run')
    return `this is a memorized text ${Date.now()}`
  },[Math.floor(count/10)])
  return (
    <div>
      {memorizedText}
      <p>this button is clicked {count} times</p>
      <button onClick={() =>setCount(count  =>  count +1)}>please click me</button>
    </div>
  )
}
